import redis
import sys
bad_proxy = [
    'http://cmcc:epay1688@172.18.232.48:8120',
    'http://cmcc:epay1688@172.18.232.49:8120',
    'http://cmcc:epay1688@172.18.232.50:8120',
    'http://cmcc:epay1688@172.18.232.51:8120',
    'http://cmcc:epay1688@172.18.232.52:8120',
    'http://cmcc:epay1688@172.18.232.53:8120',
    'http://cmcc:epay1688@172.18.232.54:8120',
    'http://cmcc:epay1688@172.18.232.55:8120',
    'http://cmcc:epay1688@172.18.232.56:8120',
    'http://cmcc:epay1688@172.18.232.57:8120',
    'http://cmcc:epay1688@172.18.232.58:8120',
    'http://cmcc:epay1688@172.18.232.59:8120',
    'http://cmcc:epay1688@172.18.232.60:8120',
    'http://cmcc:epay1688@172.18.232.61:8120',
    'http://cmcc:epay1688@172.18.232.62:8120',
]

good_proxy = [
    'http://singsin:FF23FFC2@47.75.14.41:30033',
    'http://lemon:lcoc62oZ@120.79.230.71:30001',
    'http://cmcc:epay1688@111.231.234.171:8120',
    # 'http://cmcc:epay1688@150.109.62.163:8120',
    # 'http://cmcc:epay1688@47.106.237.181:8120',
    'http://cmcc:epay1688@172.18.232.47:8120'
    # 'http://cmcc:epay1688@47.106.245.24:8120',
    'http://cmcc:epay1688@172.18.232.44:8120'
    # 'http://cmcc:epay1688@47.106.199.142:8120',
    'http://cmcc:epay1688@172.18.232.46:8120',
    # 'http://cmcc:epay1688@112.74.189.168:8120',
    'http://cmcc:epay1688@172.18.140.229:8120',
    # 'http://cmcc:epay1688@119.23.247.246:8120',
    'http://cmcc:epay1688@172.18.232.45:8120'
]

con = redis.Redis()

if __name__ == '__main__':
    if sys.argv[1] == 'add_bad':
        for p in bad_proxy:
            con.sadd('un_proxy', p)
        for p in good_proxy:
            con.srem('un_proxy', p)
    if sys.argv[1] == 'add_good':
        for p in good_proxy:
            con.sadd('un_proxy', p)
        for p in bad_proxy:
            con.srem('un_proxy', p)